package com.tsingteng.cosfun.ui.message.messagereport;

import android.util.Log;

import com.tsingteng.cosfun.bean.MessageReportBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.mvp.presenter.BasePresenter;

/**
 * 通知页面举报P层
 * 常胜
 * 2018.8.20
 * */
public class MessageReportPresenter extends BasePresenter<MessageReportContract.IMessageReportView> implements MessageReportContract.IMessageReportPresenter {

    private final MessageReportModel messageReportModel;
    private MessageReportContract.IMessageReportView view;
    public MessageReportPresenter(){
        messageReportModel = new MessageReportModel();
    }
    @Override
    public void loginMessageReport(int type) {
        view = getView();
        RxObserver<MessageReportBean> rxObserver = new RxObserver<MessageReportBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                Log.e("=====",errorMsg);
            }

            @Override
            protected void onSuccess(MessageReportBean messageReportBean) {
                view.showMessageReportResult(messageReportBean);
            }
        };
        messageReportModel.getMessageReport(type,rxObserver);
        addDisposable(rxObserver);
    }
}
